<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import NavBar from '@/components/common/NavBar.vue'

const route = useRoute()

// 判断是否需要显示导航栏（登录页不显示）
const showNavBar = computed(() => {
  return route.path !== '/login'
})
</script>

<template>
  <div class="app-container">
    <NavBar v-if="showNavBar" />
    <router-view />
  </div>
</template>

<style scoped>
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-container > :deep(router-view) {
  margin-top: 64px;
  min-height: calc(100vh - 64px);
}
</style>
